﻿using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using ST.Buz.Base.Entity;

namespace ST.Buz.Base.Mapping
{
	public partial class Map_IMS_FinanceRecvDetail : IEntityTypeConfiguration<IMS_FinanceRecvDetail>
	{
		public void Configure(EntityTypeBuilder<IMS_FinanceRecvDetail> builder)
		{
			builder.HasKey(e => new { e.ID })
				.HasName("PK_IMS_FinanceRecvDetail")
				.IsClustered(false);

			builder.HasIndex(e => new { e.RecvID })
				.HasName("IX_IMS_FinanceRecvDetail_RecvID")
				.IsClustered(true);

			//builder.HasIndex(e => new { e.DueID })
			//	.HasName("IX_IMS_FinanceRecvDetail_DueID")
			//	.IsClustered(false);

			builder.Property(e => e.Recved)
				.HasColumnType("decimal(18,2)")
				.HasDefaultValueSql("((0))")
				.ValueGeneratedNever();

			builder.Property(e => e.DetailAddDate)
				.HasDefaultValueSql("(getdate())")
				.ValueGeneratedNever();
		}
	}
}
